#include<bits/stdc++.h>
using namespace std;
int main(){
    freopen("duel.in","r",stdin);
    freopen("duel.out","w",stdout);
    int a,b[114514],c=0;
    cin>>a;
    for(int i=1;i<=a;i++){
        cin>>b[i];
    }
    for(int j=1;j<=a-1;j++){
        if(abs(b[j])>abs(b[j+1])&&b[j]>0){
            b[j+1]=0;
            b[j]=0-b[j];
        }
        else if(abs(b[j])<abs(b[j+1])){
            b[j]=0;
            b[j+1]=0-b[j+1];
        }
    }
    for(int k=1;k<=a;k++){
        if(b[k]!=0){
            c++;
        }
    }
    cout<<c;
    return 0;
}
//I support the 16-years-old-boy from Nanjing who kill the cat
